package com.project.service;

import com.project.dao.ProgrammingMapper;
import com.project.entity.Programming;
import com.project.service.base.BaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Transactional(rollbackFor = Exception.class)
@Service
public class ProgrammingServiceImpl extends BaseService implements ProgrammingService {

    @Autowired
    ProgrammingMapper programmingMapper;

    @Override
    public void add(Programming programming) {
        programmingMapper.insertSelective(programming);
    }

    @Override
    public Programming findByExerciseInfoId(Integer exerciseinfoid) {
        return programmingMapper.selectByExerciseInfoId(exerciseinfoid);
    }

    @Override
    public int modify(Programming programming)
    {
        return programmingMapper.updateByPrimaryKeySelective(programming);
    }
}
